﻿CREATE TABLE [dbo].[Order_Change_Project] (
    [Id]               INT              IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL,
    [CId]              INT              CONSTRAINT [DF_Order_Change_Project_CId] DEFAULT ((0)) NOT NULL,
    [OId]              UNIQUEIDENTIFIER NOT NULL,
    [ProductId]        INT              CONSTRAINT [DF__Order_Cha__Produ__2C352A7E] DEFAULT ((0)) NULL,
    [ProductName]      NVARCHAR (50)    NULL,
    [SupplierId]       INT              CONSTRAINT [DF__Order_Cha__Suppl__2D294EB7] DEFAULT ((0)) NULL,
    [SupplierName]     NVARCHAR (50)    NULL,
    [CostPrice]        DECIMAL (18, 2)  NULL,
    [SalePrice]        DECIMAL (18, 2)  NULL,
    [Description]      VARCHAR (MAX)    NULL,
    [TypeId]           INT              NULL,
    [TypeName]         NVARCHAR (50)    NULL,
    [IsFinish]         BIT              CONSTRAINT [DF__Order_Cha__IsFin__2E1D72F0] DEFAULT ((0)) NULL,
    [CompanyId]        INT              NULL,
    [Salesman]         NVARCHAR (50)    NULL,
    [SalesmanAccount]  NVARCHAR (50)    NULL,
    [CreateUser]       NVARCHAR (50)    NULL,
    [CreateDate]       DATETIME         NULL,
    [FinishDate]       DATETIME         NULL,
    [ExecDepartmentId] INT              CONSTRAINT [DF__Order_Cha__ExecD__2F119729] DEFAULT ((0)) NULL,
    [ExecPerson]       NVARCHAR (50)    NULL,
    [ExecPersonName]   NVARCHAR (50)    NULL,
    [FinanceAudit]     INT              NULL,
    [FinanceAuditDate] DATETIME         NULL,
    [SCateOneId]       INT              NULL,
    [SCateTwoId]       INT              NULL,
    [SubjectId]        INT              NULL,
    [UpTime]           DATETIME         CONSTRAINT [DF__Order_Cha__UpTim__3005BB62] DEFAULT (getdate()) NULL,
    [Project_Id]       INT              CONSTRAINT [DF_Order_Change_Project_Project_Id] DEFAULT ((0)) NOT NULL,
    CONSTRAINT [PK_Order_Change_Project_Id] PRIMARY KEY CLUSTERED ([Id] ASC)
);


GO
CREATE NONCLUSTERED INDEX [IX_Order_Change_Project_OId]
    ON [dbo].[Order_Change_Project]([OId] ASC);


GO
CREATE NONCLUSTERED INDEX [IX_Order_Change_Project_CId]
    ON [dbo].[Order_Change_Project]([CId] ASC);

